<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>计算器</title>
		<script type="text/javascript" src="js/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<center>
				<h1>计算器</h1>
			<input type="text" v-model="number1" />
			<select v-model="opt">
				<option value ="+">+</option>
				<option value ="-">-</option>
				<option value ="*">*</option>
				<option value ="/">/</option>
			</select>
			<input type="text" v-model="number2" />
			<input type="button" value="=" @click="but"/>
			<input type="text" v-model="result" />
			</center>
		</div>
	</body>
	<script type="text/javascript">
		var app = new Vue({
			el:'#app',
			data:{
				number1:0,
				number2:0,
				result:0,
				opt:'+'
			},
			methods:{
				but(){
					 var data = parseInt(this.number1)+this.opt+parseInt(this.number2) 
					 alert(eval(data))
				}
			}
		})
	</script>
</html>
